use std::collections::HashSet;

pub fn new_count_distinct(input_str: &str) -> usize {
    // 思路: 分词后利用HashSet记录出现过的单词，达到去重的效果
    let words: Vec<&str> = input_str.split(',').collect();
    let mut appeared_words = HashSet::new();
    for word in words {
        appeared_words.insert(word);
    }
    appeared_words.len()
}
